package com.kafang.learnaid.demo2.controller;

import com.kafang.learnaid.demo2.entity.UserEntity;
import com.kafang.learnaid.demo2.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping("/list")
    public List<UserEntity> getAllEmployees() {
        return userService.getAllEmployees();
    }
}
